<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://kit.fontawesome.com/64d58efce2.js" crossorigin="anonymous"></script>
    <link rel="stylesheet" href="./CSS/login.css" />
    <title>C2C-shopping</title>
</head>
<body>
    

    <div class="container">
        <div class="forms-container">
          <div class="signin-signup">
            <form action="#" class="sign-in-form">
              <div class="login-logo">
                <img src="./images/log_logo.svg" alt="">
    
              </div>
              <div class="input-field">
                <i class="fas fa-user"></i>
                <input type="text" name="id" placeholder="用户名"  id="zhanghao"/>
              </div>
              <div class="input-field">
                <i class="fas fa-lock"></i>
                <input type="password" name="password" placeholder="密码" id="mima" />
              </div>
              <input type="submit" value="立即登录" class="btn solid login" />
    
            </form>
    
    
    <!-- <%--注册表单--%> -->
            <form action="AdminServelt?action=adduser" method="post" class="sign-up-form">
              <div class="regis-logo">
                <img src="./images/regis_logo.svg" alt="">
    
              </div>
              <div class="input-field">
                <i class="fas fa-user"></i>
                <input type="text" name="id" placeholder="用户名" />
              </div>
              <div class="input-field">
                <i class="fas fa-envelope"></i>
                <input type="password" name="password" placeholder="密码" />
              </div>
              <div class="input-field">
                <i class="fas fa-lock"></i>
                <input type="text"  name="mail" placeholder="邮箱" />
              </div>
              <input type="submit" class="btn" value="立即注册" />
            </form>
          </div>
        </div>
    
        <div class="panels-container">
          <div class="panel left-panel">
            <div class="content">
              <h3>加入C2C商城</h3>
              <p>
                成为商城的会员吧，这里应有尽有
              </p>
              <button class="btn transparent create" id="sign-up-btn">
                去注册
              </button>
            </div>
            <img src="./images/log.svg" class="image" alt="" />
          </div>
          <div class="panel right-panel">
            <div class="content">
              <h3>已有帐号？</h3>
              <p>
                立即登录已有帐号
              </p>
              <button class="btn transparent login" id="sign-in-btn">
                去登录
              </button>
            </div>
            <img src="./images/register.svg" class="image" alt="" />
          </div>
        </div>
      </div>
      <script src="./js/login.js"></script>
      <script>
        alert("用户直接登录\n\n管理员账号：admin, 密码：123");
        let login=document.querySelector('.login')
        login.onclick=function(){
            var root=document.querySelector("#zhanghao").value
            var password=document.querySelector("#mima").value
            // alert(`${root},${password}`)
            if(root=="admin"&&password=="123"){
                window.open('./admin.html')
            }
            else{
                window.open('./index.html')
            }
        }
      </script>
      </body>
    </html>
    
